home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 April
/
PCWorld_2001-04_cd.bin
/
Komunik
/
mozilla
/
MacOS
/
MacMozillaInstaller-0.8.sea-2.bin
/
Mozilla Installer
/
Installer Modules
/
xpcom.xpi
/
install.js
Wrap
Text File
|
2001-02-15
|
2KB
|
58 lines
// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired)
{
var spaceAvailable;
// Get the available disk space on the given path
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
// Convert the available disk space into kilobytes
spaceAvailable = parseInt(spaceAvailable / 1024);
// do the verification
if(spaceAvailable < spaceRequired)
{
logComment("Insufficient disk space: " + dirPath);
logComment(" required : " + spaceRequired + " K");
logComment(" available: " + spaceAvailable + " K");
return(false);
}
return(true);
}
var srDest = 3362;
var err = initInstall("Mozilla Seamonkey", "Browser", "5.0.0.2001021502");
logComment("initInstall: " + err);
var fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);
var subFolder = "Mozilla Folder";
if (verifyDiskSpace(fProgram, srDest))
{
err = addDirectory("Program",
"5.0.0.2001021502",
"viewer", // jar source folder
fProgram, // target folder
"", // target subdir
true ); // force flag
logComment("addDirectory() returned: " + err);
if (err==SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
}
else
{
cancelInstall(err);
logComment("cancelInstall() returned: " + err);
}
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);